package org.domeos.framework.api.controller.global;

import org.domeos.basemodel.HttpResponseTemp;
import org.domeos.framework.api.service.global.PercentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import io.swagger.annotations.Api;

@Controller
@RequestMapping("/api/global/percent")
@Api("配置相关api")

public class PercentController {
	@Autowired
	PercentService percentservice;
	
	@ResponseBody
	@RequestMapping(value = "/",method=RequestMethod.GET)
	public HttpResponseTemp<?> getpercent(){
		return percentservice.getPercent();
	}
	
	@ResponseBody
	@RequestMapping(value = "/cpu/{cpupercent}/memory/{memorypercent}/",method=RequestMethod.GET)
	public HttpResponseTemp<?> updatepercent(@PathVariable String cpupercent,@PathVariable String memorypercent){
		return percentservice.updatepercent(cpupercent,memorypercent);
	}
}
